﻿<%@ WebHandler Language="C#" Class="AutoComplete" %>

using System;
using System.Web;

public class AutoComplete : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        
        // 查询的参数名称默认为term
    string query = context.Request.QueryString["term"];
    context.Response.ContentType = "text/javascript";
    //输出字符串数组 或者 JSON 数组
    context.Response.Write("[{\"label\":\"博客园\",\"value\":\"cnblogs\"},{\"label\":\"囧月\",\"value\":\"囧月\"}]");
        
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");

        //int organID = Convert.ToInt32(context.Request.QueryString["id"]);
        //context.Response.ContentType = "application/json";//"text/plain";
        //context.Response.Cache.SetNoStore();
        //string jsponString = "[";
        //System.Data.DataSet dt = new BLL.VehicleBLL().GetOrganList(1001);
        //if (dt.Tables[0].Rows.Count > 0)
        //{
        //    for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
        //    {
        //        jsponString += "\"" + dt.Tables[0].Rows[i]["FrameNO"].ToString() + "\",";//"{VehicleID:\"" + dt.Tables[0].Rows[i]["VehicleID"].ToString() + "\",FrameNO:\"" + dt.Tables[0].Rows[i]["FrameNO"].ToString() + "\"},";
        //    }
        //}
        //jsponString = jsponString.Trim(new char[] { ',' });
        //jsponString += "]";


        //string jsponString = "[\"粤AXE111\", \"粤AXE222\", \"粤AXE333\", \"粤AXE444\", \"粤AXE555\", \"粤AXE666\"]"; //"'粤AXE111,车架号：F114111','AppleScript','Asp','BASIC','川AXE222,车架号：F114222'";

        //System.Text.StringBuilder jsponString = new System.Text.StringBuilder();

        //jsponString.Append("<option value='wangtao'>");

        //jsponString.Append(context.Request.Params["type"].ToString());

        //jsponString.Append("</option>");



    //context.Response.Write(jsponString.ToString());
    //context.Response.End(); 
        
        
        
        
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}